export function formatDate(timestampParam, format) {
  // 将时间戳转换为日期对象
  const timestamp = parseInt(timestampParam) * 1000;
  const date = new Date(timestamp);
  const year = date.getFullYear();
  const month = date.getMonth() + 1;
  const day = date.getDate();
  const hours = date.getHours();
  const minutes = date.getMinutes();
  const seconds = date.getSeconds();

  // 替换需要的时间格式
  format = format.replace('yyyy', year);
  format = format.replace('MM', month < 10 ? '0' + month : month);
  format = format.replace('dd', day < 10 ? '0' + day : day);
  format = format.replace('HH', hours < 10 ? '0' + hours : hours);
  format = format.replace('mm', minutes < 10 ? '0' + minutes : minutes);
  format = format.replace('ss', seconds < 10 ? '0' + seconds : seconds);
  return format;
}
